#ifndef BACKPACK_HOTSPOT_FILTER_H_
#define BACKPACK_HOTSPOT_FILTER_H_

#include <boost/variant/static_visitor.hpp>

namespace backpack {




template <class Visitor>
class InvisibleHotSpotFilter : public boost::static_visitor<> {
public:
  InvisibleHotSpotFilter(Visitor &&visitor)
    : m_visitor(std::forward<Visitor>(visitor)) {
  }
  template <class HotSpot>
  void operator() (HotSpot &hotspot) const {
    if (hotspot.isVisible()) {
      m_visitor(hotspot);
    }
  }
private:
  Visitor m_visitor;
};


template <class Visitor>
InvisibleHotSpotFilter<Visitor> filterInvisible(Visitor &&visit) {
  return InvisibleHotSpotFilter<Visitor>(std::forward<Visitor>(visit));
}




} // namespace backpack

#endif // BACKPACK_HOTSPOT_FILTER_H_


